<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            /* line-height: 1; */
        }

        /* BFC区域 全新的 Block Format Context */
        .row{
            overflow: hidden;
        }
        .box{
            /* 标准盒模型
             * 盒子的大小= 内容(w&h) + padding + border + margin
             */

            /* box-sizing: border-box; */
            padding: 10px;
            border: 5px solid red;
            
            /* 垂直方向会重叠 */
            margin: 20px;
            width: 50%;
            /* float: left; */
             /* display: inline-block; */
            /* width: 200px; */
            /* display: inline-flex; */
            height: 100px;
            background: pink;
            color: #fff;
        }
    </style>
</head>
<body>
    <div class="row">
        <div class="box">
             a simple box
        </div>
    </div>
    <div class="box">
        another box
    </div>


    <script>
        document
            .querySelector('.box')
            .style
            .backgroundColor = "green"
    </script>
</body>
</html>